<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/static/favicon.ico">
    <title>HFish - 扩展企业安全测试主动诱导型开源蜜罐框架系统</title>
    <link href="/static/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/static/libs/bootstrap-sweetalert/sweet-alert.css" rel="stylesheet" type="text/css"/>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            overflow-y: hidden;
            overflow-x: hidden;
        }
        body {
            background-color: #26292b;
        }
    </style>
</head>


<body id="mydiv">
<div class="clearfix"></div>
<div class="wrapper-page">
    <div class="account-bg">
        <div class="card-box m-b-0">
            <div class="text-xs-center m-t-20">
                <a href="/" class="logo">
                    <img src="/static/images/logo.png" class="logoimg">
                    <div style="letter-spacing: 7px;font-size: 65px;">HFish</div>
                </a>
            </div>
            <div class="m-t-10 p-20">
                <div class="form-group row">
                    <div class="col-xs-12">
                        <input class="form-control" type="text" id="loginName" required="" placeholder="账号">
                    </div>
                </div>

                <div class="form-group row">
                    <div class="col-xs-12">
                        <input class="form-control" type="password" id="loginPwd" required="" placeholder="密码">
                    </div>
                </div>

                <div class="form-group text-center row m-t-10">
                    <div class="col-xs-12">
                        <button class="btn btn-primary btn-block waves-effect waves-light" onclick="loginFunc()"
                                type="submit">登 录
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div style="text-align: center;color: #ececec;">
        Copyright 2019 © <a href="https://github.com/hacklcx/HFish" target="_blank" style="color: #fff">HFish</a> - <a
            href="https://hack.lc"
            target="_blank" style="color: #fff">HackLC</a>
    </div>
</div>
</body>
<!-- App js -->
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/jquery.core.js"></script>
<script src="/static/js/jquery.app.js"></script>
<script src="/static/js/loginbg.js"></script>
<script src="/static/libs/bootstrap-sweetalert/sweet-alert.min.js"></script>
<script>
    window.onload = function () {
        //配置
        var config = {
            vx: 4, //小球x轴速度,正为右，负为左
            vy: 4, //小球y轴速度
            height: 2, //小球高宽，其实为正方形，所以不宜太大
            width: 2,
            count: 200, //点个数
            color: "255, 255, 255", //点颜色
            stroke: "26,129,197", //线条颜色
            dist: 6000, //点吸附距离
            e_dist: 20000, //鼠标吸附加速距离
            max_conn: 10 //点到点最大连接数
        };

        //调用
        CanvasParticle(config);
    };

    function loginFunc() {
        var loginName = $("#loginName").val();
        var loginPwd = $("#loginPwd").val();

        $.ajax({
            type: "POST",
            url: "/login",
            dataType: "json",
            data: {
                "loginName": loginName,
                "loginPwd": loginPwd
            },
            success: function (e) {
                if (e.code == "200") {
                    window.location.href = "/dashboard";
                } else {
                    swal("登录失败", e.msg, 'error');
                }
            },
            error: function (e) {
                swal("登录失败", "请 Github 提交 Issues", 'error');
            }
        });
    }
</script>
</html>